home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / optimus / agata / home.dir / 00291_3 chan.ls < prev    next >
Encoding:
Text File  |  1997-02-20  |  1.5 KB  |  44 lines

  1. property myChan1, myChan2, myChan3, maxFrames, currFrame, cast1List, x1List, y1List, cast2List, x2List, y2List, cast3List, x3List, y3List, cast1Index, cast2Index, cast3Index
  2. global theCoord
  3.  
  4. on birth me, chan1, chan2, chan3
  5.   set myChan1 to chan1
  6.   set myChan2 to chan2
  7.   set myChan3 to chan3
  8.   puppetSprite(myChan1, 1)
  9.   puppetSprite(myChan2, 1)
  10.   puppetSprite(myChan3, 1)
  11.   set the stretch of sprite myChan1 to 0
  12.   set the stretch of sprite myChan2 to 0
  13.   set the stretch of sprite myChan3 to 0
  14.   return me
  15. end
  16.  
  17. on startAnimation me
  18.   set currFrame to 1
  19. end
  20.  
  21. on Animate me
  22.   if currFrame <= maxFrames then
  23.     set cast1Index to getAt(cast1List, currFrame)
  24.     set cast2Index to getAt(cast2List, currFrame)
  25.     set cast3Index to getAt(cast3List, currFrame)
  26.     set the locH of sprite myChan1 to getAt(x1List, currFrame)
  27.     set the locV of sprite myChan1 to getAt(y1List, currFrame)
  28.     set the castNum of sprite myChan1 to cast1Index
  29.     set the locH of sprite myChan2 to getAt(x2List, currFrame)
  30.     set the locV of sprite myChan2 to getAt(y2List, currFrame)
  31.     set the castNum of sprite myChan2 to cast2Index
  32.     set the locH of sprite myChan3 to getAt(x3List, currFrame)
  33.     set the locV of sprite myChan3 to getAt(y3List, currFrame)
  34.     set the castNum of sprite myChan3 to cast3Index
  35.   end if
  36.   if currFrame > maxFrames then
  37.     set the castNum of sprite myChan1 to 0
  38.     set the castNum of sprite myChan2 to 0
  39.     set the castNum of sprite myChan3 to 0
  40.     RemoveBOL(theCoord, me)
  41.   end if
  42.   set currFrame to currFrame + 1
  43. end
  44.